<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="/js/jquery.js"></script>
    <link rel="stylesheet" href="/css/element-ui@2.13.2.index.css">
    <script src="/js/vue.min.js"></script>
    <script src="/js/vue-resource.min.js"></script>
    <script src="/js/index.js"></script>
    <script src="/js/common.js"></script>
    <!-- 字体图标css的引入 -->
    <link rel="stylesheet" href="/js/font_830376_qzecyukz0s.css">
    <link rel="stylesheet" href="/css/color-dark.css">
    <link rel="stylesheet" href="/css/icon.css">
    <link rel="stylesheet" href="/css/reset.css">
    <link rel="stylesheet" href="/css/base.css">
    <title></title>
</head>

<body>
    <div id="manage">
        <!-- 头部 -->
        <div class="wrapper">
            <!-- 头部 -->
            <div class="header">
                <!-- 折叠按钮 -->
                <div class="header-left">
                    人脸库管理
                </div>

                <!-- <div class="logo">后台管理系统</div> -->
                <div class="header-right">
                    <div class="header-user-con">
                        <!-- 全屏显示 -->
                        <div class="btn-fullscreen" @click="handleFullScreen">
                            <el-tooltip effect="dark" :content="fullscreen?`取消全屏`:`全屏`" placement="bottom">
                                <i class="el-icon-rank"></i>
                            </el-tooltip>
                        </div>
                        <div class="user-avator">
                            <img src="/image/img.jpg" />
                        </div>
                        <!-- 用户名下拉菜单 -->
                        <el-dropdown class="user-name" trigger="click" @command="handleCommand">
                            <span class="el-dropdown-link">
                                {{username}}
                                <i class="el-icon-caret-bottom"></i>
                            </span>
                            <el-dropdown-menu slot="dropdown">
                                <a href="https://github.com/lin-xin/vue-manage-system" target="_blank">
                                    <el-dropdown-item>项目仓库</el-dropdown-item>
                                </a>
                                <el-dropdown-item divided command="loginout">退出登录</el-dropdown-item>
                            </el-dropdown-menu>
                        </el-dropdown>
                    </div>
                </div>
            </div>

            <!-- 侧边部分 -->
            <div data-v-68d67528="" class="sidebar">
                <ul data-v-68d67528="" role="menubar" class="sidebar-el-menu el-menu side-ul"
                    style="background-color: rgb(50, 65, 87);">
                    <li data-v-68d67528="" role="menuitem" tabindex="-1" class="el-menu-item"
                        style="padding-left: 20px; color: rgb(191, 203, 217); background-color: rgb(50, 65, 87);"><i
                            data-v-68d67528="" class="el-icon-lx-home"></i><span data-v-68d67528="">首页</span></li>
                    <li data-v-68d67528="" role="menuitem" tabindex="-1" class="el-menu-item  is-active"
                        style="padding-left: 20px; color: rgb(32, 160, 255); background-color: rgb(50, 65, 87);"><i
                            data-v-68d67528="" class="el-icon-lx-calendar"></i><span data-v-68d67528="">人脸库管理</span>
                    </li>
                    <li data-v-68d67528="" role="menuitem" tabindex="-1" class="el-menu-item"
                        style="padding-left: 20px; color: rgb(191, 203, 217); background-color: rgb(50, 65, 87);"><i
                            data-v-68d67528="" class="el-icon-lx-global"></i><span data-v-68d67528="">特征查询</span></li>
                </ul>
            </div>

            <!-- 内容部分 -->
            <div class="content-box">
                <div class="content">
                    <div>
                        <div class="crumbs">
                            <el-breadcrumb separator="/">
                                <el-breadcrumb-item>
                                    <i class="el-icon-lx-cascades"></i> 人脸库管理
                                </el-breadcrumb-item>
                            </el-breadcrumb>
                        </div>
                        <div class="container">
                            <div class="handle-box">
                                <el-input v-model="query.name"  placeholder="输入关键词" class="handle-input mr10 el-input--small"></el-input>
                                <el-button type="primary"  size="small" icon="el-icon-search" @click="handleSearch">搜索</el-button>
                            </div>

                            <div class="img-box">
                                <div class="img-box-li">
                                    <img src="https://lin-xin.gitee.io/images/post/wms.png" alt="">
                                    <div>名称</div>
                                </div>
                                <div class="img-box-li">
                                    <img src="https://lin-xin.gitee.io/images/post/wms.png" alt="">
                                </div>
                                <div class="img-box-li">
                                    <img src="https://lin-xin.gitee.io/images/post/wms.png" alt="">
                                </div>
                                <div class="img-box-li">
                                    <img src="https://lin-xin.gitee.io/images/post/wms.png" alt="">
                                </div>
                                <div class="img-box-li">
                                    <img src="https://lin-xin.gitee.io/images/post/wms.png" alt="">
                                </div>
                                <div class="img-box-li">
                                    <img src="https://lin-xin.gitee.io/images/post/wms.png" alt="">
                                </div>
                                <div class="img-box-li">
                                    <img src="https://lin-xin.gitee.io/images/post/wms.png" alt="">
                                </div>
                                <div class="img-box-li">
                                    <img src="https://lin-xin.gitee.io/images/post/wms.png" alt="">
                                </div>
                                <div class="img-box-li">
                                    <img src="https://lin-xin.gitee.io/images/post/wms.png" alt="">
                                </div>
                                <div class="img-box-li">
                                    <img src="https://lin-xin.gitee.io/images/post/wms.png" alt="">
                                </div>
                                <div class="img-box-li">
                                    <img src="https://lin-xin.gitee.io/images/post/wms.png" alt="">
                                </div>
                                <div class="img-box-li">
                                    <img src="https://lin-xin.gitee.io/images/post/wms.png" alt="">
                                </div>
                                <div class="img-box-li">
                                    <img src="https://lin-xin.gitee.io/images/post/wms.png" alt="">
                                </div>
                                <div class="img-box-li">
                                    <img src="https://lin-xin.gitee.io/images/post/wms.png" alt="">
                                </div>
                                <div class="img-box-li">
                                    <img src="https://lin-xin.gitee.io/images/post/wms.png" alt="">
                                </div>
                                <div class="img-box-li">
                                    <img src="https://lin-xin.gitee.io/images/post/wms.png" alt="">
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        var manage = new Vue({
            el: '#manage',
            data: {
                fullscreen: false,
                query: {
                    address: '',
                    name: '',
                    pageIndex: 1,
                    pageSize: 10
                },
                tableData: [],
                multipleSelection: [],
                delList: [],
                editVisible: false,
                pageTotal: 0,
                form: {},
                idx: -1,
                id: -1
            },
            watch: {

            },
            computed: {
                username() {
                    let username = localStorage.getItem('ms_username');
                    return username ? username : this.name;
                }
            },
            mounted() {

            },
            created() {
                this.getData();
            },
            methods: {
                // 获取 easy-mock 的模拟数据
                getData() {
                    // 请求
                    // this.$http.get('js/table.json', { params: this.query }).then(function (res) {
                    //     console.log(res);
                    //     this.tableData = res.list;
                    //     this.pageTotal = res.pageTotal || 50;
                    // }, function () {
                    //     console.log('请求失败处理');
                    // });

                    // 下面是模拟的数据
                    const res = {
                        "list": [{
                            "id": 1,
                            "name": "张三",
                            "money": 123,
                            "address": "广东省东莞市长安镇",
                            "state": "成功",
                            "date": "2019-11-1",
                            "thumb": "https://lin-xin.gitee.io/images/post/wms.png"
                        },
                        {
                            "id": 2,
                            "name": "李四",
                            "money": 456,
                            "address": "广东省广州市白云区",
                            "state": "成功",
                            "date": "2019-10-11",
                            "thumb": "https://lin-xin.gitee.io/images/post/node3.png"
                        },
                        {
                            "id": 3,
                            "name": "王五",
                            "money": 789,
                            "address": "湖南省长沙市",
                            "state": "失败",
                            "date": "2019-11-11",
                            "thumb": "https://lin-xin.gitee.io/images/post/parcel.png"
                        },
                        {
                            "id": 4,
                            "name": "赵六",
                            "money": 1011,
                            "address": "福建省厦门市鼓浪屿",
                            "state": "成功",
                            "date": "2019-10-20",
                            "thumb": "https://lin-xin.gitee.io/images/post/notice.png"
                        }
                        ],
                        "pageTotal": 4
                    }
                    this.tableData = res.list;
                    this.pageTotal = res.pageTotal || 50;
                },
                // 触发搜索按钮
                handleSearch() {
                    this.$set(this.query, 'pageIndex', 1);
                    this.getData();
                },
                // 删除操作
                handleDelete(index, row) {
                    // 二次确认删除
                    this.$confirm('确定要删除吗？', '提示', {
                        type: 'warning'
                    })
                        .then(() => {
                            this.$message.success('删除成功');
                            this.tableData.splice(index, 1);
                        })
                        .catch(() => { });
                },
                // 多选操作
                handleSelectionChange(val) {
                    this.multipleSelection = val;
                },
                delAllSelection() {
                    const length = this.multipleSelection.length;
                    let str = '';
                    this.delList = this.delList.concat(this.multipleSelection);
                    for (let i = 0; i < length; i++) {
                        str += this.multipleSelection[i].name + ' ';
                    }
                    this.$message.error(`删除了${str}`);
                    this.multipleSelection = [];
                },
                // 编辑操作
                handleEdit(index, row) {
                    this.idx = index;
                    this.form = row;
                    window.location.href = 'dataAdd.html?id=1'
                },
                // 新增操作
                handAdd() {
                    window.location.href = 'dataAdd'
                },
                handleManage() {
                    this.$router.push({ path: '/dataManage' })
                },
                // 分页导航
                handlePageChange(val) {
                    this.$set(this.query, 'pageIndex', val);
                    this.getData();
                },
                // 用户名下拉菜单选择事件
                handleCommand(command) {
                    if (command == 'loginout') {
                        localStorage.removeItem('ms_username');
                        window.localStorage["token"] = '';
                        window.location.href = 'login';
                    }
                },
                // 全屏事件
                handleFullScreen() {
                    let element = document.documentElement;
                    if (this.fullscreen) {
                        if (document.exitFullscreen) {
                            document.exitFullscreen();
                        } else if (document.webkitCancelFullScreen) {
                            document.webkitCancelFullScreen();
                        } else if (document.mozCancelFullScreen) {
                            document.mozCancelFullScreen();
                        } else if (document.msExitFullscreen) {
                            document.msExitFullscreen();
                        }
                    } else {
                        if (element.requestFullscreen) {
                            element.requestFullscreen();
                        } else if (element.webkitRequestFullScreen) {
                            element.webkitRequestFullScreen();
                        } else if (element.mozRequestFullScreen) {
                            element.mozRequestFullScreen();
                        } else if (element.msRequestFullscreen) {
                            // IE11
                            element.msRequestFullscreen();
                        }
                    }
                    this.fullscreen = !this.fullscreen;
                },
            }
        })

    </script>

</body>

</html>